package controllers.remberme

import play.api.mvc.RequestHeader
import play.api.mvc.Results._
import scala.concurrent.{ExecutionContext, Future}

/**
 * Created by xinliwang on 15/9/20.
 */
trait AuthConfigImp extends BaseAuthConfig {

  def loginSucceeded(request: RequestHeader)(implicit ctx: ExecutionContext) = Future.successful(Redirect(routes.Messages.main))

  def logoutSucceeded(request: RequestHeader)(implicit ctx: ExecutionContext) = Future.successful(Redirect(routes.Session.logout))

  def authenticationFailed(request: RequestHeader)(implicit ctx: ExecutionContext) = Future.successful(Redirect(routes.Session.login))

  override lazy val tokenAccessor = new RememberMeTokenAccessor(sessionTimeoutInSeconds)

}
